.q-input {
  --field-color-base: var(--color-primary-black);
  --field-color-placeholder: rgba(var(--color-rgb-gray), 0.32);
  --field-color-disabled: rgba(var(--color-rgb-gray), 0.64);
  --field-icon-color-base: var(--color-primary-blue);
  --field-icon-color-hover: var(--color-primary-black);
  --field-icon-color-inactive: rgba(var(--color-rgb-gray), 0.64);
  --field-background-color-base: var(--color-tertiary-gray-light);
  --field-background-color-hover: var(--color-tertiary-gray);
  --field-background-color-focus: var(--color-tertiary-gray-ultra-light);
  --field-background-color-disabled: var(--color-tertiary-gray);
  --field-box-shadow-base: -1px -1px 3px rgba(var(--color-rgb-white), 0.25),
    1px 1px 3px rgba(var(--color-rgb-blue), 0.4),
    4px 4px 8px rgba(var(--color-rgb-blue), 0.4),
    -4px -4px 12px var(--color-tertiary-white);
  --field-box-shadow-hover: -1px -1px 4px rgba(var(--color-rgb-white), 0.25),
    1px 1px 4px rgba(var(--color-rgb-blue), 0.4),
    4px 4px 8px rgba(var(--color-rgb-blue), 0.4),
    -4px -4px 8px rgba(var(--color-rgb-white), 0.8);
  --field-box-shadow-focus: -1px -1px 3px rgba(var(--color-rgb-white), 0.25),
    1px 1px 3px rgba(var(--color-rgb-blue), 0.4),
    inset -1px -1px 1px rgba(var(--color-rgb-white), 0.7),
    inset 1px 1px 2px rgba(var(--color-rgb-blue), 0.2);
  --field-box-shadow-disabled: -1px -1px 3px rgba(var(--color-rgb-white), 0.25),
    1px 1px 3px rgba(var(--color-rgb-blue), 0.4);

  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;

  &__inner {
    display: inline-block;
    width: 100%;
    height: 40px;
    padding: 0 16px;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-base);
    line-height: var(--line-height-base);
    color: var(--field-color-base);
    background-color: var(--field-background-color-base);
    border: none;
    border-radius: var(--border-radius-base);
    box-shadow: var(--field-box-shadow-base);
    appearance: textfield;

    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      margin: 0;
      appearance: none;
    }

    &::placeholder,
    &:placeholder-shown {
      color: var(--field-color-placeholder);
      text-overflow: ellipsis;
      opacity: 1;
    }

    /** disable default clear on IE */
    &::-ms-reveal,
    &::-ms-clear {
      display: none;
      width: 0;
      height: 0;
    }

    &.focus-visible {
      background-color: var(--field-background-color-focus);
      outline: none;
      box-shadow: var(--field-box-shadow-focus);
    }

    &:hover {
      background-color: var(--field-background-color-hover);
      box-shadow: var(--field-box-shadow-hover);
    }

    .q-input_focus & {
      background-color: var(--field-background-color-focus);
      outline: none;
      box-shadow: var(--field-box-shadow-focus);
    }

    .q-input_disabled & {
      padding-right: 40px;
      color: var(--field-color-disabled);
      cursor: not-allowed;
      background-color: var(--field-background-color-disabled);
      box-shadow: var(--field-box-shadow-disabled);
    }

    .q-input__suffix & {
      padding-right: 40px;
    }

    .q-form-item_is-error & {
      &,
      &.focus-visible {
        padding-left: 15px;
        border: var(--border-error);
      }
    }
  }

  &_disabled {
    &::after {
      position: absolute;
      top: 0;
      right: 8px;
      // stylelint-disable-next-line font-family-no-missing-generic-family-keyword
      font-family: 'qicon';
      font-size: 24px;
      line-height: 40px;
      cursor: not-allowed;
      content: '\e912';
    }
  }

  &__suffix {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    text-align: center;
    pointer-events: none;
    transition: all 0.3s;

    .q-input.q-input_disabled & {
      display: none;
    }
  }

  &__suffix-inner {
    display: block;
    pointer-events: all;
    cursor: text;
  }

  &__icon {
    width: 40px;
    color: var(--field-icon-color-inactive);
    text-align: center;

    &_reverse {
      color: var(--field-icon-color-base);
    }

    &:not(:last-child) {
      display: none;
    }

    &::before {
      font-size: 24px;
      line-height: 40px;
    }

    &.q-icon-close,
    &.q-icon-eye,
    &.q-icon-eye-close {
      color: var(--field-icon-color-base);
      cursor: pointer;

      &::before {
        // stylelint-disable-next-line font-family-no-missing-generic-family-keyword
        font-family: 'qicon';
      }

      &.focus-visible,
      &:hover {
        color: var(--field-icon-color-hover);
      }
    }
  }

  &__count {
    position: absolute;
    top: -24px;
    right: 0;
    margin-bottom: 2px;
    font-size: 10px;
    text-align: right;
  }
}
